package com.freesun.shop.service.imp;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.freesun.shop.entity.ProdPropValue;
import com.freesun.shop.mapper.ProdPropValueMapper;

import com.freesun.shop.service.ProdPropValueService;
import org.apache.dubbo.config.annotation.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.Assert;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zf
 * @since 2019-11-13
 */
@Service
public class ProdPropValueServiceImpl extends ServiceImpl<ProdPropValueMapper, ProdPropValue> implements ProdPropValueService {

    private static Logger logger = LoggerFactory.getLogger(ProdPropValueServiceImpl.class);
    @Override
    public List<ProdPropValue> listProdById(Long id) {
        Assert.notNull(id,"要查询的商品ID不能为Null");
        logger.info("查询属性id:{}",id);
        List<ProdPropValue> prodPropValues = this.baseMapper.selectList(new LambdaQueryWrapper<ProdPropValue>()
                .eq(ProdPropValue::getPropId, id));
        return prodPropValues;
    }
}
